1. Field of the Invention
This invention relates to an image scanning technology, particularly to a device and method of correcting dark lines of a scanned image.
2. Description of the Related Art
Generally, less expensive charge couple devices (CCDs) or contact image sensors (CISs) are used in personal scanners to lower manufacturing cost. Therefore, their quality is not reliable. The CCDs in some units may fail after a period of use and lead to the xe2x80x9cdark line phenomenonxe2x80x9d in actual scanning practices. The so-called xe2x80x9cdark linesxe2x80x9d incurred in image scanning are the vertical lines, which normally are in black, but can also be in other colors. More precisely, a dark line represents a vertical line with a color being inconsistent with those of the neighboring pixels. The causes for dark lines in image scanning are specified with reference to FIG. 1 as follows.
FIG. 1 (Prior Art) is a simple diagram of a scanner. Normally, in a scanner with a CCD as a sensor component, the light will be first reflected by several reflective mirrors and refracted by lenses and then reach the CCD. The width of the CCDs is normally smaller than the scanning width due to light convergence of the lenses. In the figure, the reflective mirrors and the lenses are omitted since they are not the major concern of this invention. For the sake of convenience, the width of the CCD is set to be identical to the width of the scanned region. In FIG. 1, numeral 99 denotes a document to be scanned, 98 denotes a CCD (or CIS) scanning head. As shown in the figure, the CCD scanning head 98 is in a shape of a horizontal bar, and therefore, a bar region of the document 99 can be scanned in each scanning operation. When the CCD scanning head 98 moves downward in vertical direction, the bar regions are sequentially scanned and the document 99 can be scanned completely in such a way.
Assume that a part of the CCD scanning head 98 in FIG. 1 is damaged. For example, the CCDs P1, P2, and P3 are damaged. When the CCD scanning head 98 performs a downward scan, the scanning head 99 fails to correctly sense the part of the document that should be sensed by these damaged CCDs (P1, P2 and P3). In other words, the actual scanned data corresponding to these damaged CCDs are irrelevant to the content of the actual document. When the scanned image is directly outputted through the printer, three vertical dark lines will appear in the document. Moreover, defective pixels, such as P1, P2, and P3 of FIG. 1, result in the image dark lines.
The above description illustrates an example in which the cause for dark lines is the damaged or defective CCD components. In fact, there are other causes attributed to dark lines. For example, an obstacle in the scanning window or the optical path may also cause dark lines in the scanned image. In other words, such problem may still exist even if better CCD components are used to enhance the quality. Therefore, eradicating dark lines by correcting scanned image remains a critical issue in image processing.
Accordingly, the primary object of this invention is to provide a device and method of correcting a scanned image for eliminating the dark lines in the scanned image and recovering the actual image data in these dark lines.
According to the above object, this invention provides a method of correcting dark lines of a scanned image for correcting dark lines in a scanned image generated by an image scanner. The method comprises the following steps. First, the image scanner is driven to scan a reference document for producing a calibrated output. The reference document is a white clean calibration paper for searching the defect position that may cause dark lines. Next, a plurality of base scan data corresponding to pixel positions of the typical scanning line are generated by the aforementioned calibrated output. These base scan data can be obtained by averaging the scan data corresponding to the same pixel positions of the scanning lines of the reference document. Further, a plurality of reference scan data corresponding to the positions of the typical scanning line with aforementioned base scan data by using a numerical processing procedure, such as the left-/right-reference algorithm and the curve approximation algorithm. Next, a defect level is provided. Then the difference values between the base scan data and the corresponding reference scan data are compared with the defect level for indicating the defect positions on the typical scanning line. Finally, the scanned image generated by the same image scanner can be corrected in accordance with the indicated defect positions for eliminating the dark lines.
In addition, this invention also provides a device for correcting a scanned image outputted by the image scanner and for performing the dark line correction. The correction device comprises a base scan data calculation unit, a reference scan data calculation unit, a defect level unit, a defect marking unit and a correction unit. The base scan data calculation unit calculates a plurality of base scan data corresponding to pixel positions of the typical scanning lines according to the scan data generated by the image scanner scanning a reference document. For example, a scan is performed to a piece of white paper, and these base scan data corresponding to each pixel position of the typical scanning line is calculated by averaging the scan data at the same position of these scanning lines. Further, the reference scan data calculation unit calculates a plurality of reference scan data corresponding to the positions of the typical scanning line in accordance with the aforementioned base scan data and a numerical processing procedure. The numerical processing method can be the left-reference algorithm (performed by shifting the base scan data to the right), the right-reference algorithm (performed by shifting the base scan data to the left), or the curve approximation algorithm (performed by generate an approximate curve). Moreover, the defect level unit provides a defect level, which can be a fixed value, or a given varying value calculated from the reference scan data and the base scan data. The defect marking unit compares the difference between base scan data and reference scan with the defect level, and marks defect locations of the typical scanning line. Finally, the correction unit corrects the output of the scanned image generated by the same image scanner with the marked defect positions for eliminating dark lines.